<!-- 项目策划考核 新增|编辑|查看 -->
<template>
  <base-breadcrumb style="padding-bottom: 50px;" :breadcrumb="!isAudit">
    <a-spin :spinning="loading">
      <a-card
        v-if="(pageType == 'handelEffect' || pageType == 'handelMeasures') && !resolveInfo"
        :bordered="false"
      >
        <title-name title="处理"></title-name>
        <custom-form
          ref="effectForm"
          :is-validate="true"
          :edit-model="''"
          :rules="handelFormrules"
          :form="handelForm"
          :is-emit="false"
          :form-list="hanlelFormOption"
        >
        </custom-form>
        <div class="tool-btns">
          <a-button
            class="ml20"
            :loading="handelEffectLoading"
            type="primary"
            @click="handelEffect(1)"
          > 确定处理 </a-button>
        </div>
      </a-card>
      <a-card>
        <title-name title="基本信息" />
        <custom-form
          ref="form"
          :is-validate="true"
          :edit-model="''"
          :rules="rules"
          :form="form"
          :is-emit="false"
          :form-list="formOption"
          @selectOrg="selectOrg"
        >
        </custom-form>
      </a-card>
      <a-card>
        <title-name title="项目策划考核表" />
        <a-table
          bordered
          :data-source="tableDatas"
          :columns="columns"
          :loading="loading"
          rowKey="type"
          :scroll="{ x: 1800 }"
          :pagination="false"
        >

          <template
            slot="checkInfo"
            slot-scope="text, record"
          >
            <span class="requiredFormItem">
              <!-- 0一二三级节点完成情况 -->
              <span v-if="record.type == 0">
                一级节点，当月计划开始
                <span class="sureClick" @click="nodeclickdel('0$1')">
                  <BaseInputNumber
                    v-model="record.checkInfoObj.$1"
                    disabled
                    style="display: inline-block; width: 80px;"
                    :min="0"
                    :precision="0"
                  />
                </span>
                项，当月计划完成
                <span class="sureClick"  @click="nodeclickdel('0$2')">
                  <BaseInputNumber
                    @click="nodeclickdel('0$2')"
                    v-model="record.checkInfoObj.$2"
                    disabled
                    style="display: inline-block; width: 80px;"
                    :min="0"
                    :precision="0"
                  />
                </span>
                逾期未开始
                <span class="sureClick" @click="nodeclickdel('0$3')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('0$3')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$4"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                逾期未完成
                <span class="sureClick" @click="nodeclickdel('0$5')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('0$5')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$6"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                二级节点，当月计划开始
                <span class="sureClick" @click="nodeclickdel('0$7')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$7"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('0$8')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$8"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                逾期未开始
                <span class="sureClick" @click="nodeclickdel('0$9')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$9"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('0$9')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$10"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                逾期未完成
                <span class="sureClick" @click="nodeclickdel('0$11')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$11"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('0$11')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$12"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                三级节点，当月计划开始
                <span class="sureClick" @click="nodeclickdel('0$13')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$13"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('0$14')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$14"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                逾期未开始
                <span class="sureClick" @click="nodeclickdel('0$15')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$15"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('0$15')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$16"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /><br>
                </span>
                逾期未完成
                <span class="sureClick" @click="nodeclickdel('0$17')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$17"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为<br>
                <span class="sureClick" @click="nodeclickdel('0$17')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$18"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                />
                </span>
              </span>
              <!-- 1主要工序穿插计划执行情况 -->
              <span v-else-if="record.type == 1">
                工序穿插节点，当月计划开始
                <span class="sureClick" @click="nodeclickdel('1$1')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('1$2')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，逾期未开始
                <span class="sureClick" @click="nodeclickdel('1$3')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('1$3')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$4"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                />
                </span>
                逾期未完成
                <span class="sureClick" @click="nodeclickdel('1$5')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('1$5')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$6"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                />
                </span>
              </span>
              <!-- 2总进度计划关键线路工作完成情况（网络计划图） -->
              <span v-else-if="record.type == 2">
                当月位于关键线路上的工作为
                <span class="sureClick" @click="nodeclickdel('2$1')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$1"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                现场实际比计划
                <a-radio-group
                  v-model="record.checkInfoObj.$2"
                  :class="cellClass(record.checkInfoObj.$2)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$2', $event)"
                >
                  <a-radio value="提前">提前</a-radio>
                  <a-radio value="滞后">滞后</a-radio>
                </a-radio-group>
                <span class="sureClick">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  :disabled="!editable"
                  style="display: inline-block; width: 80px;"
                  @change="checkInfoChange(record, '$3', $event)"
                  :min="0"
                  :precision="0"
                />
                </span>
                天
              </span>
              <!-- 3垂直运输设备装拆 专项计划执行情况 -->
              <span v-else-if="record.type == 3">
                垂直运输设备装拆节点，当月计划开始
                <span class="sureClick" @click="nodeclickdel('3$1')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('3$2')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，逾期未开始
                <span class="sureClick" @click="nodeclickdel('3$3')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('3$3')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$4"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                />
                </span>
                逾期未完成
                <span class="sureClick" @click="nodeclickdel('3$5')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('3$5')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$6"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                />
                </span>
              </span>
              <!-- 4总平面布置实施情况 -->
              <span v-else-if="record.type == 4">
                项目当前处于
                <BaseInput
                  v-model="record.checkInfoObj.$1"
                  :class="cellClass(record.checkInfoObj.$1)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$1', $event)"
                  style="width: 220px; display: inline-block;"
                />
                施工阶段，<br>应执行
                <BaseInput
                  v-model="record.checkInfoObj.$2"
                  :class="cellClass(record.checkInfoObj.$2)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$2', $event)"
                  style="width: 220px; display: inline-block;"
                />
                总平面布置图；<br>主要交通组织及出入口安排
                <a-radio-group
                  v-model="record.checkInfoObj.$3"
                  :class="cellClass(record.checkInfoObj.$3)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$3', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                符合策划要求；<br>垂直运输机械配置
                <a-radio-group
                  v-model="record.checkInfoObj.$4"
                  :class="cellClass(record.checkInfoObj.$4)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$4', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                符合策划要求；<br>各专业加工场地及材料堆码场地布置
                <a-radio-group
                  v-model="record.checkInfoObj.$5"
                  :class="cellClass(record.checkInfoObj.$5)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$5', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                符合策划要求；<br>临时水电及消防布置安排
                <a-radio-group
                  v-model="record.checkInfoObj.$6"
                  :class="cellClass(record.checkInfoObj.$6)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$6', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                符合策划要求；<br>生产性现场临时设施设置（如试验室、标养室、地磅房、封样室、安全体验区、智慧工地展区、样板展示区等）
                <a-radio-group
                  v-model="record.checkInfoObj.$7"
                  :class="cellClass(record.checkInfoObj.$7)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$7', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                符合策划要求；<br>其中
                <BaseInputNumber
                  v-model="record.checkInfoObj.$8"
                  :class="cellClass(record.checkInfoObj.$8)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$8', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                项未按策划执行；<br>项目迎检观摩总平策划
                <a-radio-group
                  v-model="record.checkInfoObj.$9"
                  :class="cellClass(record.checkInfoObj.$9)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$9', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                符合策划要求；
              </span>
              <!-- 5主要施工顺序、组织流向执行情况 -->
              <span v-else-if="record.type == 5">
                现场主要施工顺序及组织流向
                <a-radio-group
                  v-model="record.checkInfoObj.$1"
                  :class="cellClass(record.checkInfoObj.$1)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$1', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                存在问题，问题主要为
                <BaseTextarea
                  v-model="record.checkInfoObj.$2"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$2)"
                  @change="checkInfoChange(record, '$2', $event)"
                /><br>
              </span>
              <!-- 6分段验收计划执行情况 -->
              <span v-else-if="record.type == 6">
                分段验收计划节点，当月计划开始
                <span class="sureClick" @click="nodeclickdel('6$1')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('6$2')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，逾期未开始
                <span class="sureClick" @click="nodeclickdel('6$3')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('6$3')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$4"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span>逾期未完成
                <span class="sureClick" @click="nodeclickdel('6$5')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('6$5')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$6"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                />
                </span>
              </span>
              <!-- 7主要资源配置执行情况 -->
              <span v-else-if="record.type == 7">
                按计划本月劳动力需求
                <span class="sureClick" @click="nodeclickdel('7$1')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                人，现场实际
                <span class="sureClick">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  :disabled="!editable"
                  style="display: inline-block; width: 80px;"
                  @change="checkInfoChange(record, '$2', $event)"
                  :min="0"
                  :precision="0"
                />
                </span>
                人，
                <a-radio-group
                  v-model="record.checkInfoObj.$3"
                  :class="cellClass(record.checkInfoObj.$3)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$3', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                存在缺口，需补充劳动力
                <BaseInputNumber
                  v-model="record.checkInfoObj.$4"
                  :class="cellClass(record.checkInfoObj.$4)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$4', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                人；<br>本月主材需求
                <a-radio-group
                  v-model="record.checkInfoObj.$5"
                  :class="cellClass(record.checkInfoObj.$5)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$5', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                存在缺口，分别为
                <BaseTextarea
                  v-model="record.checkInfoObj.$6"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$6', $event)"
                  :class="cellClass(record.checkInfoObj.$6)"
                /><br>本月周转料具需求
                <a-radio-group
                  v-model="record.checkInfoObj.$7"
                  :class="cellClass(record.checkInfoObj.$7)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$7', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                存在缺口，分别为
                <BaseTextarea
                  v-model="record.checkInfoObj.$8"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$8', $event)"
                  :class="cellClass(record.checkInfoObj.$8)"
                /><br>本月大型机械需求
                <a-radio-group
                  v-model="record.checkInfoObj.$9"
                  :class="cellClass(record.checkInfoObj.$9)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$9', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                存在缺口，分别为
                <BaseTextarea
                  v-model="record.checkInfoObj.$10"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$10)"
                  @change="checkInfoChange(record, '$10', $event)"
                />
              </span>
              <!-- 8分包进场计划执行情况 -->
              <span v-else-if="record.type == 8">
                分包招议标计划，当月计划开始
                <span class="sureClick" @click="nodeclickdel('8$1')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('8$2')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，逾期未开始
                <span class="sureClick" @click="nodeclickdel('8$3')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('8$3')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$4"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                逾期未完成
                <span class="sureClick" @click="nodeclickdel('8$5')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('8$5')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$6"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                分包合同签订计划，当月计划开始
                <span class="sureClick" @click="nodeclickdel('8$7')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$7"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('8$8')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$8"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，<br>逾期未开始
                <span class="sureClick" @click="nodeclickdel('8$9')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$9"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('8$9')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$10"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>逾期未完成
                <span class="sureClick" @click="nodeclickdel('8$11')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$11"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('8$12')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$12"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                分包进场计划，当月计划开始
                <span class="sureClick" @click="nodeclickdel('8$13')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$13"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('8$14')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$14"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，<br>逾期未开始
                <span class="sureClick" @click="nodeclickdel('8$15')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$15"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('8$15')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$16"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>逾期未完成
                <span class="sureClick" @click="nodeclickdel('8$17')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$17"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('8$17')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$18"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
              </span>
              <!-- 9分供进场计划执行情况 -->
              <span v-else-if="record.type == 9">
                分供招议标计划，当月计划开始
                <span class="sureClick" @click="nodeclickdel('9$1')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('9$2')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，逾期未开始
                <span class="sureClick" @click="nodeclickdel('9$3')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('9$3')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$4"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                逾期未完成
                <span class="sureClick" @click="nodeclickdel('9$5')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('9$5')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$6"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                分供合同签订计划，当月计划开始
                <span class="sureClick" @click="nodeclickdel('9$7')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$7"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('9$8')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$8"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，<br>逾期未开始
                <span class="sureClick" @click="nodeclickdel('9$9')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$9"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('9$9')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$10"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>逾期未完成
                <span class="sureClick" @click="nodeclickdel('9$11')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$11"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('9$11')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$12"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
                分供进场计划，当月计划开始
                <span class="sureClick" @click="nodeclickdel('9$13')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$13"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，当月计划完成
                <span class="sureClick" @click="nodeclickdel('9$14')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$14"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，<br>逾期未开始
                <span class="sureClick" @click="nodeclickdel('9$15')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$15"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('9$15')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$16"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>逾期未完成
                <span class="sureClick" @click="nodeclickdel('9$17')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$17"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                /></span>
                项，分别为
                <span class="sureClick" @click="nodeclickdel('9$17')">
                <BaseTextarea
                  v-model="record.checkInfoObj.$18"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  disabled
                /></span><br>
              </span>
              <!-- 10驻场监造 -->
              <span v-else-if="record.type == 10">
                <a-radio-group
                  v-model="record.checkInfoObj.$1"
                  :class="cellClass(record.checkInfoObj.$1)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$1', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>存在因未到场影响工期的材料，分别为：
                <BaseTextarea
                  v-model="record.checkInfoObj.$2"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$2)"
                  @change="checkInfoChange(record, '$2', $event)"
                /><br>无客观因素，计划管控有
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  :class="cellClass(record.checkInfoObj.$3)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$3', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                份未复盘或复盘与真实数据不符合，上月进场时间偏差超过5天的材料有
                <BaseTextarea
                  v-model="record.checkInfoObj.$4"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$4)"
                  @change="checkInfoChange(record, '$4', $event)"
                /><br>进场数量偏差超过20%的有
                <BaseTextarea
                  v-model="record.checkInfoObj.$5"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$5)"
                  @change="checkInfoChange(record, '$5', $event)"
                /><br>
              </span>
              <!-- 11驻场监造 -->
              <span v-else-if="record.type == 11">
                项目需驻场监造物资共
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  :class="cellClass(record.checkInfoObj.$1)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$1', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />类，已驻场监造
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  :class="cellClass(record.checkInfoObj.$2)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$2', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />类，因未排产等原因导致的物资进场存在风险的共有
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  :class="cellClass(record.checkInfoObj.$3)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$3', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                类， 分别为：
                <BaseTextarea
                  v-model="record.checkInfoObj.$4"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$4)"
                  @change="checkInfoChange(record, '$4', $event)"
                /><br>分包商主要合同有
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  :class="cellClass(record.checkInfoObj.$5)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$5', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />项未备案，分包商应排产物资
                <a-radio-group
                  v-model="record.checkInfoObj.$6"
                  :class="cellClass(record.checkInfoObj.$6)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$6', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                已经排产，应排未排物资分别为：
                <BaseTextarea
                  v-model="record.checkInfoObj.$7"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$7)"
                  @change="checkInfoChange(record, '$7', $event)"
                /><br>
              </span>
              <!-- 12重大技术方案执行情况 -->
              <span v-else-if="record.type == 12">
                当月计划编制论证的重大方案
                <span class="sureClick" @click="nodeclickdel('12$1')">
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  disabled
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                </span>
                项，未完成
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  :class="cellClass(record.checkInfoObj.$2)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$2', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                项，分别为
                <BaseTextarea
                  v-model="record.checkInfoObj.$3"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$3)"
                  @change="checkInfoChange(record, '$3', $event)"
                /><br>
                当月计划实施的重大方案
                <BaseInputNumber
                  v-model="record.checkInfoObj.$4"
                  :class="cellClass(record.checkInfoObj.$4)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$4', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                项，未规范交底及验收的
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  :class="cellClass(record.checkInfoObj.$5)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$5', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />
                项，分别为
                <BaseTextarea
                  v-model="record.checkInfoObj.$6"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$6)"
                  @change="checkInfoChange(record, '$6', $event)"
                />
              </span>
              <!-- 13过磅率 -->
              <span v-else-if="record.type == 13">
                项目
                <a-radio-group
                  v-model="record.checkInfoObj.$1"
                  :class="cellClass(record.checkInfoObj.$1)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$1', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                配置地磅，若未配置，
                <a-radio-group
                  v-model="record.checkInfoObj.$2"
                  :class="cellClass(record.checkInfoObj.$2)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$2', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                执行报告程序。<br/>
                钢筋过磅率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  :class="cellClass(record.checkInfoObj.$3)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$3', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，混凝土过磅率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$4"
                  :class="cellClass(record.checkInfoObj.$4)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$4', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，<br/>
                型材过磅率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$5"
                  :class="cellClass(record.checkInfoObj.$5)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$5', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，砂石过磅率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$6"
                  :class="cellClass(record.checkInfoObj.$6)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$6', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，<br/>
                桥架过磅率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$7"
                  :class="cellClass(record.checkInfoObj.$7)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$7', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，抗震支架过磅率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$8"
                  :class="cellClass(record.checkInfoObj.$8)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$8', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，<br/>
                其他专业主材过磅率分别为：
                <BaseTextarea
                  v-model="record.checkInfoObj.$9"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$9)"
                  @change="checkInfoChange(record, '$9', $event)"
                /><br>
              </span>
              <!-- 14现场材料浪费、废料率情况 -->
              <span v-else-if="record.type == 14">
                钢筋废料率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$1"
                  :class="cellClass(record.checkInfoObj.$1)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$1', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，型材废料率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  :class="cellClass(record.checkInfoObj.$2)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$2', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，塑料管材废料率为
                <BaseInputNumber
                  v-model="record.checkInfoObj.$3"
                  :class="cellClass(record.checkInfoObj.$3)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$3', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />%，<br/>
                现场物资
                <a-radio-group
                  v-model="record.checkInfoObj.$4"
                  :class="cellClass(record.checkInfoObj.$4)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$4', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                <br/>
                存在浪费情况，主要情况分别为：
                <BaseTextarea
                  v-model="record.checkInfoObj.$5"
                  :autoSize="{ minRows: 1, maxRows: 5 }"
                  :max-length="5000"
                  :disabled="!editable"
                  :class="cellClass(record.checkInfoObj.$5)"
                  @change="checkInfoChange(record, '$5', $event)"
                /><br>
              </span>
              <!-- 15周检巡查记录 -->
              <span v-else-if="record.type == 15">
                本月周巡检
                <a-radio-group
                  v-model="record.checkInfoObj.$1"
                  :class="cellClass(record.checkInfoObj.$1)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$1', $event)"
                >
                  <a-radio value="是">是</a-radio>
                  <a-radio value="否">否</a-radio>
                </a-radio-group>
                按周执行，已执行
                <BaseInputNumber
                  v-model="record.checkInfoObj.$2"
                  :class="cellClass(record.checkInfoObj.$2)"
                  :disabled="!editable"
                  @change="checkInfoChange(record, '$2', $event)"
                  style="display: inline-block; width: 80px;"
                  :min="0"
                  :precision="0"
                />次
              </span>
            </span>

          </template>

          <template
            slot="grade"
            slot-scope="text, record"
          >
            <span
              v-if="record.type !== 100"
              class="requiredFormItem"
            >
              <BaseInputNumber
                v-model="record.grade"
                :class="cellClass(record.grade)"
                :disabled="!editable"
                @change="checkInfoChange(record, 'grade', $event)"
                :min="0"
                :precision="0"
                :max="record.standardGrade"
              />
            </span>
            <span v-else>{{record.grade}}</span>
          </template>

          <template
            slot="problemInfo"
            slot-scope="text, record"
          >
            <span v-if="!editable">{{ record.problemInfo || '-' }}</span>
            <span v-else>
              <BaseTextarea
                v-if="record.type !== 100"
                v-model="record.problemInfo"
                :autoSize="{ minRows: 6, maxRows: 10 }"
                :maxLength="5000"
                :disabled="!editable"
                @change="checkInfoChange(record, 'problemInfo', $event)"
              />
            </span>
          </template>

          <!-- <span v-if="activeKey == '0'"> -->
          <span
            slot="measures"
            slot-scope="text, record"
            :class="record.problemInfo ? 'requiredFormItem' : ''"
          >
            <span v-if="editable || pageType == 'handelMeasures'">
              <BaseTextarea
                v-if="record.type !== 100"
                v-model="record.measures"
                :autoSize="{ minRows: 6, maxRows: 10 }"
                :maxLength="5000"
                :disabled="!record.problemInfo"
                :class="cellClass(record.measures)"
                @change="checkInfoChange(record, 'measures', $event)"
              />
            </span>
            <span v-else>{{ record.measures || '-' }}</span>
          </span>
          <span
            slot="measuresTime"
            slot-scope="text, record"
            :class="record.problemInfo ? 'requiredFormItem' : ''"
          >
            <span v-if="editable || pageType == 'handelMeasures'">
              <a-date-picker
                v-if="record.type !== 100"
                v-model="record.measuresTime"
                format="YYYY-MM-DD"
                valueFormat="YYYY-MM-DD HH:mm:ss"
                :disabled="!record.problemInfo"
                :class="cellClass(record.measuresTime)"
                @change="checkInfoChange(record, 'measuresTime', $event)"
              />
            </span>
            <span v-else>{{ record.measuresTime || '-' }}</span>
          </span>
          <template
            slot="effect"
            slot-scope="text, record"
          >
            <span
              v-if="record.type !== 100"
              :style="text ? {} : { color: '#ff0000' }"
            >{{ isEmpty(record.problemInfo) ? '-' : (text || '未填写') }}</span>
          </template>
          <!--  -->
          <!-- </span> -->
        </a-table>
      </a-card>
      <div
        v-if="!isConsultation"
        class="tool-btns page-btn-right-top"
        style="position: fixed; bottom: 0px; right: 50px; height: 50px; display: flex; align-items: center;"
      >
        <a-button
          v-if="editable"
          class="ml20"
          :loading="defLoading"
          type="primary"
          @click="handleSubmit(0)"
        > 保存草稿 </a-button>
        <a-button
          v-if="editable"
          class="ml20"
          :loading="submitLoading"
          type="primary"
          @click="handleSubmit(1)"
        > 提交 </a-button>
        <a-button
          class="ml20"
          @click="handleClose"
        > 关闭 </a-button>
      </div>
    </a-spin>
    <detailedModal
      :projectId="form.projectId"
      :month="form.examineMonth"
      :nodeType="nodeType"
      :visible="visibleModal" 
      @closeModal="()=>visibleModal=false"></detailedModal>
  </base-breadcrumb>
</template>
<script>
import SelectSubCompany from '@/components/Select/SelectSubCompany'
import SelectProject from '@/components/Select/SelectProject'
import SelectPersonByProject from '@/components/Select/SelectPersonByProject'
import detailedModal from './detailedModal'
import { getProjectsDel } from '@/api/project/projects.js'
import { addPlanExamine, updatePlanExamine, queryPlanExamineById, addPlanExamineProcess, getPlanValues } from '@/api/project/projectPlanningAssessment'
import { finishBusinessTodo } from '@/api/commons.js'
import { formTable } from './model.js'
import moment from 'moment'
import { notifyParentWindow } from '@/utils/util.js'
export default {
  name: 'a' + Date.now(),
  components: {
    SelectSubCompany,
    SelectPersonByProject,
    detailedModal
  },
  props: {
    // 是否作为审批详情
    isAudit: {
      type: Boolean,
      default: false
    },
    // 是否作为意见征询
    isConsultation: {
      type: Boolean,
      default: false
    }
    },
  data() {
    return {
      // 页面加载
      loading: false,
      isValidate: false,
      visibleModal: false,
      nodeType: '',
      handelForm: {
        effect: '',
        taskName: '',
        effectTime: '',
        name: ''
      },
      // 表单
      form: {
        branchComId: '', // 分公司id
        branchComName: '', // 分公司名称
        projectId: '', // 项目id
        projectName: '', // 项目名称
        projectImportanceId: '', // 项目重要程度id
        projectImportanceName: '', // 项目重要程度name
        examineCompanyId: '', // 考核单位id（抽查特有字段）
        examineYearMonth: '', // 考核月度
        examineCompanyName: '', // 考核单位name（抽查特有字段）
        examineUserId: '', // 考核人id（自查特有字段）
        examineUserName: '', // 考核人name（自查特有字段）
        examineTime: '' // 考核时间: '',
      },
      formTable: [],
      // 提交loading
      submitLoading: false,
      defLoading: false,
      handelEffectLoading: false
    }
  },
  created() {
    this.loading = true
    if (this.pageType == 'add') {
      this.initPage()
      this.formTable = this.$clone(formTable)
      // this.getCheckInfoData();
    } else {
      queryPlanExamineById(this.$route.query.id)
        .then((res) => {
          if (res.code == 0) {
            this.form = res.data
            this.formTable = res.data.planExamineCheckItems
            this.getCheckInfoData();
            this.loading = false
            this.initPage()
          }
        })
        .catch(() => {
          this.loading = false
        })
    }
  },
  computed: {
    cellClass() {
      return (val) => {
        return this.isValidate && this.isEmpty(val) ? 'validate_err' : ''
      }
    },
    activeKey() {
      return this.$route.query.activeKey
    },
    currentPost() {
      return this.$currentPost()
    },
    pageType() {
      return this.$route.query.type
    },
    // 是否是业务待办查看处理信息
    resolveInfo: {
      get() {
        return this.$route.query?.resolveInfo === 'true'
      },
      set() {}
    },
    editable() {
      return this.pageType == 'add' || this.pageType == 'edit'
    },
    hanlelFormOption() {
      let list1 = [
        {
          label: '重要工期节点控制-完成效果',
          keyName: 'effect',
          span: 24,
          type: 'BaseTextarea',
          rules: [{ required: true, message: '请输入', trigger: 'blur' }],
          attrs: {
            maxLength: 3000
          }
        }
      ]
      let list = [
        {
          label: '当前处理节点',
          keyName: 'taskName',
          disabled: true,
          type: 'BaseInput'
        },
        {
          label: '办理人',
          keyName: 'name',
          disabled: true,
          type: 'BaseInput'
        },
        {
          label: '办理时间',
          keyName: 'effectTime',
          disabled: true,
          type: 'BaseInput'
        }
      ]
      return this.pageType == 'handelEffect' ? list1.concat(list) : list
    },
    handelFormrules() {
      const obj = {}
      this.hanlelFormOption.map((item) => {
        if (item.rules) {
          obj[item.keyName] = item.rules
        }
      })
      return obj
    },
    // 表单配置
    formOption() {
      let list = [];
      if(this.activeKey === '0') {
        list = [
          {
            label: '所属单位',
            keyName: 'projectId',
            type: 'orgTree',
            //表单项关联
            isAutoSelectFirst: this.pageType == 'add',
            disabled: this.pageType !== 'add',
            checkStrictly: true,
            rules: [{ required: true, message: '请选择', trigger: 'change' }],
            span: 16
          },
          // {
          //   label: "分公司",
          //   keyName: "branchComId",
          //   type: SelectSubCompany,
          //   attrs: {
          //     //表单项关联
          //     autoSelected: this.pageType == 'add'
          //   },
          //   disabled: true,
          //   rules: [{ required: true, message: "请选择", trigger: "change" }],
          //   selectChange: (e) => {
          //     this.form.branchComName = e?.orgName || ''
          //   }
          // },
          // {
          //   label: "项目名称",
          //   keyName: "projectId",
          //   type: SelectProject,
          //   attrs: {
          //     //表单项关联
          //     autoSelected: true,
          //     keyValue: "branchComId",
          //     isEdit: true,
          //     form: this.form
          //   },
          //   disabled: true,
            // rules: [{ required: true, message: "请选择", trigger: "change" }],
            // selectChange: (e) => {
            //   if (!e) {
            //     this.form.projectName = ''
            //     this.form.projectImportanceId = ''
            //     this.form.projectImportanceName = ''
            //     return
            //   }
            //   this.form.projectName = e.name
            //   this.getCheckInfoData()
            //   getProjectsDel({projectId: e.code}).then((res) => {
            //     if (res.code == 200) {
            //       this.form.projectImportanceId = res.data.projectImportanceCode
            //       this.form.projectImportanceName = res.data.projectImportanceName
            //     } else {
            //       this.form.projectImportanceId = ''
            //       this.form.projectImportanceName = ''
            //     }
            //   })
            // }
          // },
          {
            label: '项目重要程度',
            keyName: 'projectImportanceName',
            disabled: true,
            type: 'BaseInput'
          },
          {
            label: '考核月度',
            keyName: 'examineYearMonth',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '考核人',
            keyName: 'examineUserName',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '考核时间',
            keyName: 'examineTime',
            type: 'a-date-picker',
            attrs: {
              format: 'YYYY-MM-DD',
              valueFormat: 'YYYY-MM-DD HH:mm:ss'
            },
            disabled: true
          }
        ]
      }else {
        list = [
          {
            label: '所属单位',
            keyName: 'projectId',
            type: 'orgTree',
            //表单项关联
            isAutoSelectFirst: this.pageType == 'add',
            disabled: this.pageType !== 'add',
            checkStrictly: true,
            rules: [{ required: true, message: '请选择', trigger: 'change' }],
            span: 16
          },
          // {
          //   label: "分公司",
          //   keyName: "branchComId",
          //   type: SelectSubCompany,
          //   attrs: {
          //     //表单项关联
          //     autoSelected: this.pageType == 'add'
          //   },
          //   disabled: true,
          //   rules: [{ required: true, message: "请选择", trigger: "change" }],
          //   selectChange: (e) => {
          //     this.form.branchComName = e?.orgName || ''
          //   }
          // },
          // {
          //   label: "项目名称",
          //   keyName: "projectId",
          //   type: SelectProject,
          //   attrs: {
          //     //表单项关联
          //     autoSelected: true,
          //     keyValue: "branchComId",
          //     isEdit: true,
          //     form: this.form
          //   },
          //   disabled: true,
            // rules: [{ required: true, message: "请选择", trigger: "change" }],
            // selectChange: (e) => {
            //   if (!e) {
            //     this.form.projectName = ''
            //     this.form.projectImportanceId = ''
            //     this.form.projectImportanceName = ''
            //     return
            //   }
            //   this.form.projectName = e.name
            //   this.getCheckInfoData()
            //   getProjectsDel({projectId: e.code}).then((res) => {
            //     if (res.code == 200) {
            //       this.form.projectImportanceId = res.data.projectImportanceCode
            //       this.form.projectImportanceName = res.data.projectImportanceName
            //     } else {
            //       this.form.projectImportanceId = ''
            //       this.form.projectImportanceName = ''
            //     }
            //   })
            // }
          // },
          {
            label: '项目重要程度',
            keyName: 'projectImportanceName',
            disabled: true,
            type: 'BaseInput'
          },
          {
            label:  '考核月度',
            keyName: 'examineYearMonth',
            type: 'a-month-picker',
            disabled: this.pageType == 'add' ? false : true,
            attrs: {
              format: 'YYYY-MM',
              valueFormat: 'YYYY-MM'
            },
          },
          {
            label: '考核单位',
            keyName: 'examineCompanyName',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '考核人',
            keyName: 'examineUserName',
            type: 'BaseInput',
            disabled: true
          },
          {
            label: '考核时间',
            keyName: 'examineTime',
            type: 'a-date-picker',
            attrs: {
              format: 'YYYY-MM-DD',
              valueFormat: 'YYYY-MM-DD HH:mm:ss'
            },
            disabled: true
          }
        ]
      }
      
      return list
    },
    // 校验
    rules() {
      const obj = {}
      this.formOption.map((item) => {
        if (item.rules) {
          obj[item.keyName] = item.rules
        }
      })
      return obj
    },
    tableDatas() {
      let list = []
      this.formTable.forEach((item, index) => {
        let child = item.planExamineCheckItemDetails
        item.grade = child.reduce((acc, cur) => {
          return acc + Number(cur.grade)
        }, 0)
        item.problem = this.isEmpty(item.problemInfo) ? 0 : 1
        child.forEach((sub, idx) => {
          let obj = { ...sub }
          obj.mainName = item.name
          obj.problemInfo = item.problemInfo
          obj.mainSort = item.sort
          obj.measures = item.measures
          obj.measuresTime = item.measuresTime
          obj.effect = item.effect
          obj.effectTime = item.effectTime
          obj.checkInfoObj = JSON.parse(sub.checkInfo)
          if (idx == 0) {
            obj.rowSpan = child.length
          } else {
            obj.rowSpan = 0
          }
          list.push(obj)
        })
      })
      // list.push({
      //   type: 100,
      //   mainName: '合计',
      //   standardGrade: list.reduce((acc, cur) => {
      //     return acc + Number(cur.standardGrade)
      //   }, 0),
      //   grade: list.reduce((acc, cur) => {
      //     return acc + Number(cur.grade)
      //   }, 0)
      // })
      // console.log('list', list);
      return list
    },
    columns() {
      let list = [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          customRender(text, record, index) {
            const obj = {
              children: Number(record.mainSort) + 1 || '',
              attrs: {}
            }
            obj.attrs.rowSpan = record.rowSpan
            return obj
          }
        },
        {
          title: '检查项',
          dataIndex: 'mainName',
          colSpan: 2,
          width: 200,
          customRender: (value, row, index) => {
            const obj = {
              children: value,
              attrs: {rowSpan: row.rowSpan}
            }
            return obj
          }
        },
        {
          title: '细项',
          colSpan: 0,
          width: 200,
          dataIndex: 'name',
          // customRender: (value, row, index) => {
          //   const obj = {
          //     children: value,
          //     attrs: {rowSpan: index===9?2:undefined}
          //   }
          //   return obj
          // }
        },
        {
          title: '关联文件',
          dataIndex: 'fileName',
          width: 200
        },
        // {
        //   title: '标准分',
        //   dataIndex: 'standardGrade',
        //   width: 80
        // },
        {
          title: '检查内容',
          dataIndex: 'examineStandard',
          width: 200
        },
        {
          title: '检查记录明细',
          dataIndex: 'checkInfo',
          width: 440,
          scopedSlots: { customRender: 'checkInfo' }
        },
        // {
        //   title: '得分',
        //   dataIndex: 'grade',
        //   width: 120,
        //   scopedSlots: { customRender: 'grade' }
        // },
        {
          title: '存在的问题说明',
          dataIndex: 'problemInfo',
          width: 240,
          scopedSlots: { customRender: 'problemInfo' },
          customCell: (row, index) => {
            const obj = {
              style: { display: row.rowSpan === 0 ? 'none' : undefined },
              attrs: {
                rowSpan: row.rowSpan
              }
            }
            return obj
          }
        }
      ]
      let list2 = [
        {
          title: '纠偏措施',
          dataIndex: 'measures',
          width: 240,
          scopedSlots: { customRender: 'measures' },
          customCell: (row, index) => {
            const obj = {
              style: { display: row.rowSpan === 0 ? 'none' : undefined },
              attrs: {
                rowSpan: row.rowSpan
              }
            }
            return obj
          }
        },
        {
          title: '完成时间',
          dataIndex: 'measuresTime',
          width: 240,
          scopedSlots: { customRender: 'measuresTime' },
          customCell: (row, index) => {
            const obj = {
              style: { display: row.rowSpan === 0 ? 'none' : undefined },
              attrs: {
                rowSpan: row.rowSpan
              }
            }
            return obj
          }
        }
      ]
      let list3 = [
        {
          title: '完成效果',
          dataIndex: 'effect',
          scopedSlots: { customRender: 'effect' },
          width: 240,
          customCell: (row, index) => {
            const obj = {
              style: { display: row.rowSpan === 0 ? 'none' : undefined },
              attrs: {
                rowSpan: row.rowSpan
              }
            }
            return obj
          }
        },
        {
          title: '完成效果填写时间',
          dataIndex: 'effectTime',
          width: 120,
          customCell: (row, index) => {
            const obj = {
              style: { display: row.rowSpan === 0 ? 'none' : undefined },
              attrs: {
                rowSpan: row.rowSpan
              }
            }
            return obj
          }
        }
      ]
      // return list
      if (this.editable) {
        return this.activeKey == '1' || this.activeKey == '2' ? list : list.concat(list2)
      } else {
        return this.pageType == 'handelMeasures' ? list.concat(list2) : list.concat(list2, list3)
      }
    }
  },
  methods: {
    selectOrg(val) {
      this.form.branchComName = val[val.length - 2].orgName
      this.form.branchComId = val[val.length - 2].orgId
      this.form.projectId = val[val.length - 1].projectId
      this.$refs.form.clearValidate('projectId')
      this.getCheckInfoData()
      getProjectsDel({ projectId: this.form.projectId }).then((res) => {
        if (res.code == 200) {
          this.form.projectName = res.data.projectName
          this.form.projectImportanceId = res.data.projectImportanceCode
          this.form.projectImportanceName = res.data.projectImportanceName
        } else {
          this.form.projectImportanceId = ''
          this.form.projectImportanceName = ''
        }
      })
    },
    initPage() {
      this.loading = false
      let { userId, name } = this.$userInfo().employee
      if (this.editable) {
        this.form.examineUserId = userId // 考核人id（自查特有字段）
        this.form.examineUserName = name // 考核人name（自查特有字段）
        this.form.examineTime = moment().format('YYYY-MM-DD HH:mm:ss') // 考核时间: '' 传给后端加时分秒
        if (!this.form.examineYearMonth){
          this.form.examineYearMonth = moment().format('YYYY年MM月')
        }
        this.form.examineYear = moment().format('YYYY')
        this.form.examineMonth = moment().format('YYYYMM')
        if (this.activeKey == '0') {
          // this.form.examineYearMonth = moment().format('YYYY年MM月')
          this.form.examineMonth = moment().format('YYYYMM')
        } else {
          let { orgId, orgName } = this.currentPost
          this.form.examineCompanyId = orgId // 考核单位id（抽查特有字段）
          this.form.examineCompanyName = orgName // 考核单位name（抽查特有字段）
        }
      }
      if (this.pageType == 'handelEffect' || this.pageType == 'handelMeasures') {
        // const currentPost = this.$userInfo().employee.posts.find((el) => el.id === this.$userInfo().currentPost.postId)
        this.handelForm.effectTime = moment().format('YYYY-MM-DD HH:mm:ss')
        this.handelForm.name = name
        // this.handelForm.taskName = `${this.currentPost.orgName}/${currentPost.orgName}/${currentPost.name}`
        this.handelForm.taskName = this.currentPost.orgName
      }
    },
    getCheckInfoData() {
      if(this.pageType=='look') return;
      getPlanValues({examineMonth: this.form.examineMonth}, this.form.projectId)
        .then((res) => {
          this.loading = false
          if (res.code == 0) {
            let data = res.data
            data.forEach((item, index) => {
              for (let idx in item) {
                let val = item[idx]
                if (idx !== 'type') {
                  this.checkInfoChange(item, idx, val)
                }
              }
            })
          }
        })
        .catch(() => {
          this.loading = false
        })
    },
    checkInfoChange(record, key, e) {
      let { type } = record
      // let value = typeof e == 'object' ? e.target.value : e
      let value
      if(typeof e == 'object' && e !== null) {
        value = e === null ? '无' : e.target.value
      }else {
        value = e
      }
      this.formTable = this.formTable.map((item, index) => {
        item.planExamineCheckItemDetails.map((sub, idx) => {
          if (sub.type == type) {
            if (key.startsWith('$')) {
              let checkInfo = JSON.parse(sub.checkInfo)
              checkInfo[key] = value
              sub.checkInfo = JSON.stringify(checkInfo)
            } else if (key === 'problemInfo') {
              item[key] = value
              if (this.isEmpty(value)) {
                item['measures'] = ''
                item['measuresTime'] = null
                item['effect'] = ''
                item['effectTime'] = null
              }
            } else if (key === 'measures' || key === 'measuresTime') {
              item[key] = value
            } else {
              sub[key] = value
            }
          }
          return sub
        })
        return item
      })
    },
    handelEffect() {
      try {
        let isEffect = this.pageType == 'handelEffect'
        this.$refs.effectForm.validate(async (valid) => {
          if (valid) {
            let { effect, effectTime } = this.handelForm
            let form = this.getSumForm()
            if (isEffect) {
              let completeEffect = false
              this.formTable = this.formTable.map((item, index) => {
                if (item.id == this.$route.query.planExamineCheckItemsId) {
                  item.effect = effect
                  item.effectTime = effectTime
                }

                if (!this.isEmpty(item.problemInfo)) {
                  completeEffect = !this.isEmpty(item.effect) && !this.isEmpty(item.effectTime)
                }
                return item
              })
              form = this.getSumForm()
              form.completeEffect = completeEffect ? '已完成' : '未完成'
            } else {
              this.isValidate = true
              if (!this.validateTable()) return
            }
            // 区分是待办时的编辑
            form.isEdit = 2
            this.handelEffectLoading = true
            let res = await updatePlanExamine(form)
            this.isValidate = false
            if (res.code == 0) {
              if (!isEffect) {
                // 调用发起审批接口
                await addPlanExamineProcess(this.$route.query.id)
              }
              await finishBusinessTodo({ id: this.$route.query.messageId })
              this.$message.success('处理成功')
              this.handleClose()
            } else {
              this.$message.error('处理失败')
            }
            this.handelEffectLoading = false
          }
        })
      } catch (e) {
        console.error(e)
      }
    },
    getSumForm(state) {
      const form = this.$clone(this.form)
      form.companyId = '53085e2c9f1f4685801ef31994f57c49' // 公司id
      form.companyName = '西南公司' // 公司名称
      if (!this.isEmpty(state)) {
        form.state = state // 状态0待提交1已提交/审核中2未考核3审核不通过4审核通过
      }
      if (this.editable) {
        form.type = this.activeKey == '0' ? this.activeKey : '1' // 业务类型0自查1抽查
        if(this.activeKey>0) {
          form.conpanyType = this.activeKey
        }
      }
      form.version = 1 // 版本
      let planExamineCheckItems = this.$clone(this.formTable)
      // sessionStorage.setItem('formTable', JSON.stringify(planExamineCheckItems))
      form.planExamineCheckItems = planExamineCheckItems
      form.problem = planExamineCheckItems.find((v) => v.problemInfo) ? 1 : 0
      if (state == 1 && form.problem == 1) {
        let completeEffect = planExamineCheckItems.find((v) => {
          return !this.isEmpty(v.problemInfo) && this.isEmpty(v.effect) && this.isEmpty(v.effectTime)
        })
        form.completeEffect = completeEffect ? '未完成' : '已完成'
      }
      if (state == 0 && !this.isEmpty(form.completeEffect)) {
        form.completeEffect = ''
      }
      form.isEdit = 0
      form.grade = planExamineCheckItems.reduce((acc, cur) => {
        return acc + Number(cur.grade)
      }, 0)
      // if(state == 1 && !form.examineTime) {
      //   form.examineTime = moment().format('YYYY-MM-DD HH:mm:ss')
      // }
      form.examineTime = moment().format('YYYY-MM-DD HH:mm:ss')
      return form
    },
    /**
     * @description: 提交
     * @param {void}
     * @return {void}
     */
    handleSubmit(state) {
      let btnkey = state == 0 ? 'defLoading' : 'submitLoading'
      this.isValidate = state == 1
      if (state == 1 && !this.validateTable()) {
        return
      }

      this[btnkey] = true

      let form = this.getSumForm(state)
      form.companyType = this.activeKey;
      form.createType = 1;
      let api = this.pageType == 'add' ? addPlanExamine : updatePlanExamine
      api(form)
        .then((res) => {
          this[btnkey] = false
          this.isValidate = false
          if (res.code == 0) {
            let msg = state == 0 ? '保存成功！' : '提交成功'
            this.$message.success(msg)
            this.handleClose()
          }
        })
        .catch(() => {
          this[btnkey] = false
          this.isValidate = false
        })
    },
    validateTable() {
      let flag = true
      // let planExamineCheckItems = this.$clone(this.formTable);
      // sessionStorage.setItem('formTable', JSON.stringify(planExamineCheckItems))
      if (this.editable) {
        this.$refs.form.validate((valid) => {
          if (!valid) {
            flag = false
            return flag
          }
        })
      }
      let tableDatas = this.$clone(this.tableDatas)
      for (let i = 0; i < tableDatas.length; i++) {
        let obj = tableDatas[i]
        let checkInfoFlag = true
        for (let idx in obj.checkInfoObj) {
          let item = obj.checkInfoObj[idx]
          if (this.isEmpty(item)) {
            checkInfoFlag = false
            console.log('1111', obj)
            break
          }
        }
        // if (!checkInfoFlag || this.isEmpty(obj.grade)) {
        //   flag = false
        //   break
        // }
        if (!checkInfoFlag) {
          flag = false
          console.log('2222')
          break
        }
        if (this.activeKey == '0' || this.pageType == 'handelMeasures') {
          if (!this.isEmpty(obj.problemInfo) && (this.isEmpty(obj.measures) || this.isEmpty(obj.measuresTime))) {
            flag = false
            console.log('3333')
            break
          }
        }
      }
      if (!flag) {
        this.$message.error('请填写完整！')
      }
      return flag
    },
    isEmpty(val) {
      return val === '' || val === undefined || val === null
    },
    /**
     * @description: 关闭
     * @param {void}
     * @return {void}
     */
    handleClose() {
      // 不知道之前为何关闭要跳转到待办事项
      // this.$router.replace("/matters/list/todo?tabKey=business")
      if(this.isAudit){
        notifyParentWindow()
        window.close()
      }else{
        this.$router.back()
      }
    },
    rowSpanNum(data) {
      let num = 0;
      data.forEach((item, index)=> {
        if(item.planExamineCheckItemDetails && item.planExamineCheckItemDetails.length>0) {
          num += item.planExamineCheckItemDetails.length
        }else {
          num += 1
        }
      })
      return num
    },
    nodeclickdel(type) {
      this.visibleModal = true;
      this.nodeType = type;
    },
  }
}
</script>
<style lang="less" scoped>
.sureClick {cursor: pointer;}
/deep/ .requiredFormItem .validate_err .ant-input:not([disabled]),
/deep/ .requiredFormItem .validate_err .ant-time-picker-input,
/deep/ .requiredFormItem .validate_err .ant-select:not(.ant-select-disabled) .ant-select-selection,
/deep/ .requiredFormItem .validate_err .ant-calendar-picker-input,
/deep/ .requiredFormItem .validate_err .ant-input-number-input,
/deep/ .requiredFormItem .validate_err .ant-radio-inner,
/deep/ .requiredFormItem .validate_err .ant-cascader-picker {
  border-color: #f5222d;
}
.sureClick {
  position:relative;
  ::after {
    content: '';
    position:absolute;
    width:100%;
    height:100%;
    top:0;
    left:0;
  }
}
</style>
